package com.binc.testspring.study.io;

import java.io.*;
import java.util.Arrays;

/**
 * FileName: TestBufferReader
 * Autho: binC
 * Date:  2022/3/30 14:00
 */
public class TestBufferReader {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("D:\\binC\\idea_resp\\binc_code\\getServiceImpls\\src\\main\\java\\com\\binc\\testspring\\study\\mina\\study2\\说明"));
        String s;
        // while (true){
        //     if ((s = br.readLine()) != null) {
        //         System.out.println(s);
        //     }else{
        //         break;
        //     }
        // }
        char[] c = new char[18];
        int len = br.read(c);
        System.out.println("长度："+len);
        System.out.println(Arrays.toString(c));
        String s1 = new String(c, 0, c.length);
        System.out.println(s1);
        System.out.println("===================");
        String abc = br.readLine();
        System.out.println(abc);
        int read = br.read(c);
        System.out.println(Arrays.toString(c));

        br.close();


        FileInputStream fileInputStream = new FileInputStream(new File("D:\\binC\\idea_resp\\binc_code\\getServiceImpls\\src\\main\\java\\com\\binc\\testspring\\study\\mina\\study2\\说明"));
        byte[] bb = new byte[18];
        int read1 = fileInputStream.read(bb);
        String string = new String(bb, 0, bb.length);
        System.out.println("["+string+"]");


    }
}
